package SoundSystem;

import java.net.URL;

import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.Clip;

import Game.Mainth;

public class Sound {
	private Clip sound;
	
	public Sound(String SoundPath){
		try{
			sound=AudioSystem.getClip();
			URL url=new URL("data/sound/" + SoundPath);
			AudioInputStream inputStream = AudioSystem.getAudioInputStream(url);
			sound.open(inputStream);
		}catch (Exception e) {
			System.err.println(e.getMessage());
	    }
	}
	public void playSound(){
		sound.start();
		
	}
	public void stopSound(){
		sound.stop();
	}
	public void update(){
			
	}
}
